Skip to content

v0.42.0 (#215): PARS bull trout + Arctic grayling habitat-connectivity vignette#216

Merged
NewGraphEnvironment merged 10 commits into
mainfrom
215-vignette-pars-peace-mapping-code-link-bc
Jun 3, 2026
Merged

v0.42.0 (#215): PARS bull trout + Arctic grayling habitat-connectivity vignette#216
NewGraphEnvironment merged 10 commits into
mainfrom
215-vignette-pars-peace-mapping-code-link-bc

Conversation

@NewGraphEnvironment

@NewGraphEnvironment NewGraphEnvironment commented Jun 1, 2026

Copy link
Copy Markdown
Owner

Summary

  • First package vignette: vignettes/pars-habitat-connectivity.Rmd — bull trout and Arctic grayling habitat & connectivity classification for the Parsnip River Watershed Group (PARS, FWCP Peace), rehearsed end-to-end so it can transfer into the Fish Passage Peace 2025 report appendix.
  • Two analyses: parity — link's bcfishpass config reproduces bcfishpass per-segment mapping_code for bull trout at 99.04%; extension — link's default config models Arctic grayling, which bcfishpass does not model at all.
  • Tunnel-free by design: model run + comparison run once locally in data-raw/wsg_vignette_data.R, caching pars.gpkg + pars_parity.rds to inst/vignette-data/. The vignette only loads those, so pkgdown CI builds it with no Postgres and no bcfishpass snapshot. Model-run chunks are eval=FALSE.
  • Map symbology reuses the bcfishpass symbology registry bundled in gq: colour keyed on barrier status, line width keyed on habitat use (SPAWN thick, REAR medium, ACCESS thin), so the maps match a bcfishpass QGIS project exactly.

Cross-repo dependency

This PR consumes a new return field (widths) from gq_tmap_classes(), added in NewGraphEnvironment/gq#30. link installs gq from its main Remote, so gq#30 must merge before this PR's CI (pkgdown / build-vignettes) goes green.

Related Issues

Notes

Test plan

  • Vignette renders tunnel-free (bookdown::html_vignette2, figures numbered); no DB touched at build
  • bcfishpass line widths verified visually (full-WSG + detail panels)
  • /code-check clean (fresh-eyes review of the combined link + gq diff)
  • CI: pkgdown / R-CMD-check / build-vignettes green (after gq#30 merges)

🤖 Generated with Claude Code

NewGraphEnvironment and others added 10 commits May 31, 2026 02:47
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
Add bookdown/knitr/rmarkdown/terra/xciter/gq to Suggests, VignetteBuilder:
knitr, and gq/xciter Remotes. Create vignettes/ + references.bib seeded with
the canonical smnorris stack (bcfishpass/fwapg/bcfishobs).

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
data-raw/pars_vignette_data.R reads the authoritative #175 DS-first study-area
persists (fresh = bcfp config, fresh_default = default config; model state is
NOT recomputed — a standalone PARS run would miss cross-WSG ;DAM tokens). Runs
tunnel-free lnk_compare_mapping_code (BT 99.04% — the only bcfp-config species
in the Peace, above the WAC Bennett Dam), captures lnk_stamp provenance, and
pulls aoi/streams/waterbodies into inst/vignette-data/pars.gpkg. streams carry
mapping_code_bt (fresh) for the parity map and mapping_code_gr (fresh_default,
19,233 segments) for the Arctic-grayling showcase bcfishpass does not model.

ship-small: ZM-dropped + 15 m simplify, modelled-network subset -> 9.7 MB gpkg.
gq registry matches 99.99% of BT + GR tokens. rollup/annotate dropped (need the
live bcfp tunnel; would break the tunnel-free no-DB design).

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
…howcase

vignettes/pars-mapping-code.Rmd: 8 sections rendering tunnel-free from the
Phase 2 cached artifacts (gpkg + 2 rds via system.file). Shows link's
bcfishpass config reproducing bcfishpass per-segment mapping_code for bull
trout (99.04% parity, the only bcfp-config species above WAC Bennett Dam),
then extends to Arctic grayling — a species bcfishpass does not model.
Symbology reuses the gq bcfishpass registry (gq_reg_main + gq_tmap_classes,
fresh's recipe so stream colours match bcfishpass exactly. Model-run chunks
eval=FALSE; positioning follows fish_passage_template_reporting#192
(complements + extends the smnorris stack, never supersedes).

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
EOF
)
Wrap three long kable-caption / sprintf strings with paste0 so the vignette
passes lint_package() with 0 lints (120-char limit). Verified the vignette
renders tunnel-free via both the bookdown::html_vignette2 engine (figures
numbered) and pkgdown::build_article (figures, tables, citations all resolve);
no database is touched at build — chunks read only the cached system.file
artifacts.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
Minor bump for the first package vignette (bcfishpass parity + Arctic
grayling extension for PARS). NEWS section + DESCRIPTION version/date.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
…radient fix

- data-raw/wsg_vignette_data.R (renames pars_vignette_data.R): AOI-parameterized
  via `aoi`/`stub` so the script re-points to any WSG with a one-line edit.
  Adds flooded-style context layers fetched with real data via fresh::frs_db_conn()
  (reserves, parks, resource roads, railways), ST_Intersects-clipped to the WSG.
- vignettes/pars-mapping-code.Rmd: fold drainage geography into the intro
  (Parsnip -> Williston -> Peace -> Slave -> Mackenzie -> Arctic); drop the
  dedicated "why bull trout" section, the stamp chunk, xciter, and references.
  Maps gain context layers + reserve diamond markers with halo labels;
  legend moved into a reserved right margin (no map overlap); detail map zoomed
  to the flooded/Peace SE-corner bbox. Params table corrects GR access gradient
  (0.15, not 0.25) and adds spawn/rear max gradients + channel-width minima.
- DESCRIPTION: drop xciter (Remotes + Suggests) and terra (Suggests).
- Delete references.bib + pars_stamp.rds; regenerate pars.gpkg (8 layers).

Relates to NewGraphEnvironment/sred#24

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
…, accuracy edits

Rename pars-mapping-code.Rmd -> pars-habitat-connectivity.Rmd and retitle around
bull trout + Arctic grayling habitat/connectivity classification (mapping_code
demoted from the title). Incorporate bcfishpass line widths from the gq registry
(gq_tmap_classes()$widths): habitat use drives line weight (SPAWN thick, REAR
medium, ACCESS thin), barrier status drives colour — matching a bcfishpass QGIS
project. Add a plain-language mapping_code grammar paragraph; correct the colour
example to statuses present in PARS (no NONE/blue tokens in this network). Sync
NEWS.md + data-gen comment to the new filename and accurate artifact/dependency
lists (drop terra/xciter, pars_stamp.rds).

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
The SRED repo is NewGraphEnvironment/sred (sred-2025-2026 was renamed). Fix both
the SRED section ref (#24) and the branching-convention example.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
@NewGraphEnvironment NewGraphEnvironment changed the title v0.42.0 (#215): PARS Peace mapping_code vignette — bcfp parity + grayling showcase v0.42.0 (#215): PARS bull trout + Arctic grayling habitat-connectivity vignette Jun 3, 2026
@NewGraphEnvironment NewGraphEnvironment merged commit a156e6f into main Jun 3, 2026
1 check passed
@NewGraphEnvironment NewGraphEnvironment deleted the 215-vignette-pars-peace-mapping-code-link-bc branch June 3, 2026 19:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Vignette: PARS Peace mapping_code — link/bcfp parity + Arctic grayling showcase (Peace 2025 appendix prep)

1 participant